Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function SetMenuItemInfo Lib "user32" Alias "SetMenuItemInfoA" (ByVal hMenu As Long, ByVal un As Long, ByVal bypos As Long, lpcMenuItemInfo As MENUITEMINFO) As Long
Private Const MF_BITMAP = &H4&
Private Const MFT_BITMAP = MF_BITMAP
Private Const MIIM_TYPE = &H10
' See if it is safe to discard the data.
Private Function DataSafe() As Boolean
If Not DataModified Then
' The data has not been modified. It's safe.
DataSafe = True
Else
' Ask the user if we should save changes.
Select Case MsgBox("The data has been modified. Do you want to save the changes?", vbYesNoCancel)